package exercise05;

public class Bicycle extends Vehicle {
    public Bicycle(double maxSpeed, double weight) {
        super(maxSpeed, weight);
        speed = 0;
    }

    @Override
    public void run(double speed) {
        if (speed > maxSpeed) {
            speed = maxSpeed;
        }
        this.speed = speed;
        System.out.println("自行车正在运行，速度为：" + speed);
    }

    @Override
    public void stop() {
        this.speed = 0;
        System.out.println("自行车停止，速度为：" + speed);
    }

}

